<%@include file="/WEB-INF/common/taglibs.jsp"%>
<script type="text/javascript"
	src="${ctx}/resources/js/datatable-query.js"></script>
<div class="row-fluid">
<div class="span12">
<div class="box gradient">
<div class="title">
<h4><span>Feedback </span></h4>
<a href="#" class="minimize">Minimize</a></div>
<div class="content scrollable clearfix">
<table class="ajaxTable display table table-bordered">
	<thead>
		<tr>
			<th><a id="select_all"><span
				class="icomoon-icon-checkmark-2"></span></a></th>
			<th>Email</th>
			<th>Subject</th>
			<th>Comment</th>
			<th>Enquiry Date</th>
		</tr>
	</thead>
</table>
</div>
</div>

</div>

<a href="${ctx}/spm-contact/generate/" class="btn btn-info"> <span
	class="icon12 icomoon-icon-plus white"></span> Generate</a></div>


<script type="text/javascript">

var render = false;
 
$(document).ready(function () {
 	johnny.oTable = $('.ajaxTable').dataTable({
		"bLengthChange": true,
		"sAjaxSource": '${ctx}/spm-contact/',
		"fnInitComplete": function (oSettings, json) { }
	});
	var name = $("<input>").attr({
		type: "text",
		field: "name",
		op: "cn",
		placeholder: "Name",
		class: "filterdata"
	});
	johnny.initTableQuery(name);
	var config = {
			id : 'del',
			text  : 'Del',
			domain : "FeedBacl",
			operation : "Delete",
			url : "${ctx}/spm-contact/del/"
	};
	johnny.tableBtn(config);

	
});
function updateGrid() {
	window.clearTimeout(oTime);
	oTime = setTimeout(function () { oTable.fnDraw(); }, 500);
}

var columnHeader = ['email', 'subject','comment','enquiryDate'];
var QueryData = function (aoData) {
	return johnny.initQueryData(aoData, columnHeader);
}

var DataTableForm = function (json, echo) {
	var dataArray = new Array();
	for (var i = 0; i < json.result.length; i++) {
		var subArray = new Array();
		var value = johnny.getForSelect(json.result[i].id);
 		subArray.push(value);
		subArray.push(json.result[i].email);
		subArray.push(json.result[i].subject);
		subArray.push(json.result[i].comment);
		subArray.push(json.result[i].enquiryDate);
 		dataArray.push(subArray);
	}
	return {
		sEcho: echo,
		iTotalRecords: json.totalCount,
		iTotalDisplayRecords: json.totalCount,
		aaData: dataArray
	};
}
</script>
<body>